package
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.text.TextField;
	import flash.text.TextFieldType;
	import flash.text.TextFormat;
	
	public class TestFont extends Sprite
	{
		[Embed(source = "123.jpg")]
		private var image:Class;
		
		public function TestFont()
		{
			super();
			stage.scaleMode = StageScaleMode.NO_SCALE; //取消默认的大小
			stage.align=StageAlign.TOP_LEFT; //对其到左上角
			
			var text:TextField = new TextField();
			text.width = 100;
			text.height = 300;
			
			text.text = "just a test";
			
			text.type = TextFieldType.INPUT;
			text.wordWrap = true;
			text.multiline = true;
			
			addChild(text);
			
			var textformat:TextFormat = new TextFormat("just a test", 21, 0xff0000);
			textformat.leading = 201 -21;
			text.setTextFormat(textformat, 2, 3);
			//text.
			
			var img:DisplayObject = new image();
			img.x = 100;
			addChild(img);
		}
	}
}